package com.vhall.component.entity.dictionary.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author shimingming
 * @since 2023/4/14 10:31
 */
@Getter
@AllArgsConstructor
public enum GuoXinAccountTypeEnum implements BaseEnum {


    TOURIST(1, "游客"),
    REGISTERED_USERS(2, "注册用户"),
    TRANSACTION_LOGIN(3, "交易登录"),
    BIND_ACCOUNT_USERS(4, "绑定账户用户"),
    ;

    private Integer value;

    private String name;

    public static String getName(Integer value) {
        for (GuoXinAccountTypeEnum template : GuoXinAccountTypeEnum.values()) {
            if (template.getValue().equals(value)) {
                return template.name;
            }
        }
        return null;
    }

    public static GuoXinAccountTypeEnum parse(Integer value) {
        for (GuoXinAccountTypeEnum type : GuoXinAccountTypeEnum.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }

}
